home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / basic / qbfaqr01.zip / EGASAVE.BAS < prev    next >
BASIC Source File  |  1992-08-10  |  3KB  |  76 lines

  1. 'Date: 04-10-92 (01:16)
  2. 'From: BOB IRVINE
  3. 'Subj: BSAVE/BLOAD
  4.  
  5. 'These routines will BSAVE/BLOAD screens 9 or 12. in 4 files,
  6. '?????.PC0, ?????.PC1, ?????.PC2, ?????.PC3.
  7. 'The sub LoadEGAscreen requests that the mode be specified in order
  8. 'to correctly set up the correct count for the save.  LoadEGAscreen
  9. 'will only load the bitcount that was specified in the original
  10. 'BSAVE
  11. '
  12. 'The OUT statements bump the port address of the video ram on the
  13. 'graphics board, so as the screen loads you will see each succesive
  14. 'screen painted on the screen.  Only in screen 9 can you switch the
  15. 'active page while you load.  When the load is complete you can flip
  16. 'the completed page into view.  SCREEN 12 does not support page swapping
  17. 'as there is only one page.
  18.  
  19.  
  20. SUB LoadEGAscreen (FileName$)
  21.  P = INSTR(FileName$, ".")                'STRIP OFF EXTENSION IF
  22.  IF P > 0 THEN                            'PRESENT
  23.    FileName$ = LEFT$(FileName$, P - 1)
  24.  END IF
  25.  DEF SEG = &HA000                         'POINT TO VIDEO RAM
  26.  OUT &H3C4, 2
  27.  OUT &H3C5, 1
  28.  BLOAD FileName$ + ".PC0", 0              'LOAD BIT PLANE 0
  29.  OUT &H3C4, 2                             '964,2
  30.  OUT &H3C5, 2                             '965,2
  31.  BLOAD FileName$ + ".PC1", 0              'LOAD BIT PLANE 1
  32.  OUT &H3C4, 2
  33.  OUT &H3C5, 4
  34.  BLOAD FileName$ + ".PC2", 0              'LOAD BIT PLANE 2
  35.  OUT &H3C4, 2
  36.  OUT &H3C5, 8
  37.  BLOAD FileName$ + ".PC3", 0              'LOAD BIT PLANE 3
  38.  OUT &H3C4, 2
  39.  OUT &H3C5, &HF
  40.  DEF SEG
  41. END SUB
  42.  
  43.  
  44. SUB SaveEGAscreen (FileName$, MODE)
  45.  SELECT CASE MODE
  46.    CASE 9
  47.      BitCount& = 28000
  48.    CASE 12
  49.      BitCount& = 38400
  50.    CASE ELSE
  51.      BEEP
  52.      PRINT "***********************************************"
  53.      PRINT "**  MODE SELECTION ERROR IN SAVE EGA SCREEN  **"
  54.      PRINT "***********************************************"
  55.  END SELECT
  56.  P = INSTR(FileName$, ".")                'STRIP OFF EXTENSION IF
  57.  IF P > 0 THEN                            'PRESENT
  58.    FileName$ = LEFT$(FileName$, P - 1)
  59.  END IF
  60.  DEF SEG = &HA000                         'POINT TO VIDEO RAM
  61.  OUT &H3CE, 4
  62.  OUT &H3CF, 0
  63.  BSAVE FileName$ + ".PC0", 0, BitCount&    'SAVE BIT PLANE 0
  64.  OUT &H3CE, 4
  65.  OUT &H3CF, 1
  66.  BSAVE FileName$ + ".PC1", 0, BitCount&    'SAVE BIT PLANE 1
  67.  OUT &H3CE, 4
  68.  OUT &H3CF, 2
  69.  BSAVE FileName$ + ".PC2", 0, BitCount&    'SAVE BIT PLANE 2
  70.  OUT &H3CE, 4
  71.  OUT &H3CF, 3
  72.  BSAVE FileName$ + ".PC3", 0, BitCount&    'SAVE BIT PLANE 3
  73.  OUT &H3CE, 4                             'RESTORE EGA CARD
  74.  OUT &H3CF, 0                             'REGISTERS
  75.  DEF SEG
  76. END SUB